package com.fancy.framework
{
	public class BundleLeader implements IBundleLeader
	{
		protected var context:BundleContext;
		
		public function BundleLeader(context:BundleContext)
		{
			this.context = context;
		}
		
		public function getModuleName():String
		{
			throw new Error(this + ":getModuleName()方法需要被重写");
			return null;
		}
		
		public function getLevel():uint
		{
			return 0;
		}
		
		public function initializeLeader():void
		{
		}
		
		public function send(notice:BundleNotice):void
		{
			if(notice.module)
			{
				BundleManager.instance.getLeaderByModuleName(notice.module).execute(notice);
			}
			else
			{
				Debug.Error("无指定消息发送对象模块名，此消息执行失败");
			}
		}
		
		public function execute(notice:BundleNotice):void
		{
			throw new Error(this + ":execute(notice:BundleNotice)方法需要被重写");
		}
	}
}